using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class UI_BlackScreen : MonoBehaviour
{
    [SerializeField] private UI_MainMenu menu = null;
    [SerializeField] private UI_YouDied UI_Youdied = null;

    private Animator anim;

    private void Start()
    {
        anim = GetComponent<Animator>();
    }

    private void FadeOutToChangeScene()
    {
        if (menu == null)
            return;

        SceneManager.LoadScene(menu.SceneName);
    }

    private void ShowYouDied()
    {
        if(UI_Youdied == null)
            return;
        
        UI_Youdied.ShowYouDied();
    }

    public void FadeOut() => anim.SetTrigger("FadeOut");
    public void FadeIn() => anim.SetTrigger("FadeIn");
}
